指定した推奨のアイテムの取得

get
/resources/v1/aggregates/{siteName}/engage/recommendation/{recommendationName}/items
リソース・エンドポイントは、指定されたサイト名に属する指定された推奨アセットに対する集約された結果を返します。

重要な注意: これは、コレクション・リソースです。指定した推奨名の推奨されたアセットはすべて、レスポンスのアイテム配列で提供されます。各結果も集約されたアセットです。そのため、すべての集約アセット問合せパラメータ(assetDepth、expand、fields)はこのリソースにも適用されます。これらの集約アセット問合せパラメータは、アイテム配列の各結果に適用されます。集約アセット問合せパラメータの詳細は、「アセット・リソース・エンドポイント」を参照してください。

次の表に、クライアント・リクエストをまとめます。

パス・パラメータ
名前 説明 形式
recommendationName 推奨項目の名前 文字列
siteName サイトの名前 文字列
問合せパラメータ
名前 説明 形式
assetDepth このパラメータの詳細は、「アセット・リソース・エンドポイント」の'assetDepth'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 数値
expand assetTypeのカンマ区切りのリストを受け入れます。このパラメータの詳細は、「アセット・リソース・エンドポイント」の'expand'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 文字列
fields このパラメータの詳細は、「アセット・リソース・エンドポイント」の'fields'問合せパラメータを参照してください。アイテム配列の各結果に適用されます。 文字列
limit 返されるアイテムの合計数を指定します。 数値
links リンク名のカンマ区切りのリストを受け入れます。デフォルトでは、このパラメータですべてのリンク(next、prev、first、last、schema、selfおよびcanonicalリソース)が返されます。 文字列
offset 結果を返す開始地点となる開始索引を指定します。 数値
profileName 推奨の評価基準のSitesVisitorServiceプロファイル名 文字列
segments 推奨の評価基準となるカンマ区切りのセグメント名を受け入れます。 文字列
totalResults ブール値を受け入れます。trueに設定すると、レスポンスに結果総数フィールドが表示されます。デフォルトはfalseです。 ブール
visitorid 推奨の評価基準の訪問者ID 数値

次の表に、サーバー・レスポンスをまとめます。

サポートされるメディア・タイプ
  • application/json

200レスポンス

集約された形式の推奨アセット結果

例1

次の例に、cURLを使用してRESTリソースに対するGETリクエストを送信し、WebCenter Sitesでavisportsサンプル・サイトのRunning Recommendationのデフォルト・セグメントの最初の3つの推奨されたAVIArticle名を取得する方法を示します。

REST URLで、describedbyリンクのみを返すことも指定します。

問合せパラメータの詳細:

  • "limit=3": 最初の3つの結果。'offset'が指定されていないため、デフォルトは0です。

  • "assetDepth=0&fields=name&expand=AVIArticle": 推奨アセット(AVIArticles)はすべて'items'配列で提供されます。各アイテム(AVIArticle)は集約されたアセットであるため、そのアイテムのルート・アセットです。そのルート・アセットAVIArticleの名前のみ必要です。

  • "links=describedby": describedbyリンクのみ表示されます。

curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/engage/recommendation/Running%20Recommendation/items?limit=3&assetDepth=0&fields=name&expand=AVIArticle&links=describedby"

例1 レスポンス・ヘッダー

次の例に、レスポンス・ヘッダーを示します。

<Response header>HTTP/1.1 200 OK
ETag: "55c120a176afb1d146809c4cbc6e28d0d5ed5272622addc139c0a4e6e9630048" 
Cache-Control: max-age=0
Content-Type: application/json;charset=utf-8

例1 レスポンス本文

次の例に、JSON形式のレスポンス本文のコンテンツを示します。

{
  "offset": 0,
  "limit": 8,
  "count": 3,
  "hasMore": true,
  "links": [
	{
      "href": "http://<host>:<port>/<context>/REST/resources/v1/metadata-catalog/aggregates/avisports/engage/recommendation/Running%20Recommendation/items",
      "rel": "describedby",
      "templated": false,
      "mediaType": "application/schema+json",
      "method": "GET",
      "profile": ""
    }
  ],
  "items": [
    {
      "metadata": {
        "confidence": 100,
        "rating": 50
      },
      "start": "AVIArticle:1363104090649",
      "AVIArticle:1363104090649": {
        "name": "How Fast Should Beginners Run",
        "parents": [
          {
            "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351718403",
            "rel": "assetReference",
            "templated": false,
            "mediaType": "",
            "method": "GET",
            "profile": ""
          }
        ]
      }
    },
    {
      "AVIArticle:1328196048335": {
        "name": "Runner Connie Grant Signs Endorsement Deal with Maverick USA",
        "parents": [
          {
            "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351718403",
            "rel": "assetReference",
            "templated": false,
            "mediaType": "",
            "method": "GET",
            "profile": ""
          }
        ]
      },
      "metadata": {
        "confidence": 90,
        "rating": 50
      },
      "start": "AVIArticle:1328196048335"
    },
    {
      "metadata": {
        "confidence": 80,
        "rating": 50
      },
      "AVIArticle:1363104085499": {
        "name": "3 Surprising Ways to Enjoy Treadmill Running",
        "parents": [
          {
            "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351718403",
            "rel": "assetReference",
            "templated": false,
            "mediaType": "",
            "method": "GET",
            "profile": ""
          }
        ]
      },
      "start": "AVIArticle:1363104085499"
    }
  ]
}

例2

次の例に、cURLを使用してRESTリソースに対するGETリクエストを送信し、WebCenter Sitesでavisportsサンプル・サイトのRunning RecommendationのMaleに対する2番目の2つの推奨されたAVIArticle名およびIDを取得する方法を示します。

REST URLで、nextリンクのみを返すことも指定します。

問合せパラメータの詳細:

  • "segments=Male": Maleの推奨されたアセットのみ必要です。

  • "offset=2&limit=2": 2番目の2つの結果であるため、オフセット2から始まります。

  • "assetDepth=0&fields=name,id&expand=AVIArticle": 推奨アセット(AVIArticles)はすべて'items'配列で提供されます。各アイテム(AVIArticle)は集約されたアセットであるため、そのアイテムのルート・アセットです。そのルート・アセットAVIArticlename、id値のみ必要です。

  • "links=next": nextリンクのみ表示されます。

curl -i -H "Accept: application/json" -X GET "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/engage/recommendation/Running%20Recommendation/items?segments=Male&offset=2&limit=2&assetDepth=0&fields=name,id&expand=AVIArticle&links=next"

例2 レスポンス・ヘッダー

次の例に、レスポンス・ヘッダーを示します。

HTTP/1.1 200 OK
ETag: "0ca74042d77c17a854ff9fcde80c7fb41deeca7e5c443822ac8e14b0e2253759"
Cache-Control: max-age=0
Content-Type: application/json;charset=utf-8

例2 レスポンス本文

次の例に、JSON形式のレスポンス本文のコンテンツを示します。

{
  "offset": 2,
  "limit": 8,
  "count": 2,
  "hasMore": true,
  "links": [
    {
      "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/engage/recommendation/Running%20Recommendation/items?expand=AVIArticle&offset=4&limit=2&links=next&fields=name,id&assetDepth=0&segments=Male",
      "rel": "next",
      "templated": false,
      "mediaType": "",
      "method": "",
      "profile": ""
    }
  ],
  "items": [
    {
      "metadata": {
        "confidence": 80,
        "rating": 50
      },
      "AVIArticle:1363104043066": {
        "name": "England Tries to Capitalize on Its Running Fame",
        "id": 1363104043066,
        "parents": [
          {
            "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351718403",
            "rel": "assetReference",
            "templated": false,
            "mediaType": "",
            "method": "GET",
            "profile": ""
          }
        ]
      },
      "start": "AVIArticle:1363104043066"
    },
    {
      "AVIArticle:1363104016159": {
        "name": "Male Guide To Running Faster",
        "id": 1363104016159,
        "parents": [
          {
            "href": "http://<host>:<port>/<context>/REST/resources/v1/aggregates/avisports/ArticleCategory/1327351718403",
            "rel": "assetReference",
            "templated": false,
            "mediaType": "",
            "method": "GET",
            "profile": ""
          }
        ]
      },
      "metadata": {
        "confidence": 80,
        "rating": 50
      },
      "start": "AVIArticle:1363104016159"
    }
  ]
}